﻿using Orleans;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Zj.OrleansDemo.Interface;

namespace Zj.OrleansDemo.ConsoleView
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread.Sleep(10000);
            GrainClient.Initialize();
            while (true)
            {
                Console.WriteLine("请输入用户Id:");
                var input = Console.ReadLine();
                int? id = 0;
                if (string.IsNullOrEmpty(input))
                {
                    id = null;
                }
                else
                {
                    id = Convert.ToInt32(input);
                }

                var _service = GrainClient.GrainFactory.GetGrain<IUserService>(0);
                _service.AddOrUpdateAsync(id);
            }
        }
    }
}
